﻿<%@ Page Title="Bewerk Festivals" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Festivals.aspx.cs" Inherits="WebApplication2.EditPages.Festivals" %>
<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1><%: Title %>.</h1>
                <h2>Groep16 - Festivalinfo</h2>
            </hgroup>
            <p>
                Hier kan je de gegevens van de tabel Festivals bewerken.
            </p>
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="fest_id" DataSourceID="SqlDataSource1" AutoGenerateEditButton="True" AutoGenerateDeleteButton="True" OnRowEditing="GridView1_RowEditing" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting">
        <Columns>
            <asp:BoundField DataField="fest_id" HeaderText="id" InsertVisible="False" ReadOnly="True" SortExpression="fest_id" />
            <asp:BoundField DataField="fest_naam" HeaderText="naam" SortExpression="fest_naam" />
            <asp:BoundField DataField="fest_locatie" HeaderText="locatie" SortExpression="fest_locatie" />
            <asp:BoundField DataField="fest_datum" HeaderText="datum" SortExpression="fest_datum" />
            <asp:BoundField DataField="fest_duur" HeaderText="duur" SortExpression="fest_duur" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:groep16_festivalsConnectionString %>" SelectCommand="SELECT * FROM [festivals]" DeleteCommand="DELETE FROM [festivals] WHERE [fest_id] = @fest_id" InsertCommand="INSERT INTO [festivals] ([fest_naam], [fest_locatie], [fest_datum], [fest_duur]) VALUES (@fest_naam, @fest_locatie, @fest_datum, @fest_duur)" UpdateCommand="UPDATE [festivals] SET [fest_naam] = @fest_naam, [fest_locatie] = @fest_locatie, [fest_datum] = @fest_datum, [fest_duur] = @fest_duur WHERE [fest_id] = @fest_id">
        <DeleteParameters>
            <asp:Parameter Name="fest_id" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="fest_naam" Type="String" />
            <asp:Parameter Name="fest_locatie" Type="String" />
            <asp:Parameter DbType="Date" Name="fest_datum" />
            <asp:Parameter Name="fest_duur" Type="Int32" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="fest_naam" Type="String" />
            <asp:Parameter Name="fest_locatie" Type="String" />
            <asp:Parameter DbType="Date" Name="fest_datum" />
            <asp:Parameter Name="fest_duur" Type="Int32" />
            <asp:Parameter Name="fest_id" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>

</asp:Content>
